From 1035824919d9f4a60ef2a47efc1a2c51526a2bc9 Mon Sep 17 00:00:00 2001 From: "vh249@arcadians.cl.cam.ac.uk" Date: Tue, 26 Apr 2005 13:37:38 +0000 Subject: [PATCH] bitkeeper revision 1.1386 (426e4422Fnf4uJoD_xnCwL17Xg94aA) remove redundant NULL check before xfree() Signed-off-by: Vincent Hanquez --- xen/arch/x86/shadow.c | 4 ++-- xen/common/dom0_ops.c | 3 +-- xen/common/domain.c | 6 ++---- xen/common/grant_table.c | 3 +-- xen/common/physdev.c | 7 ++----- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/xen/arch/x86/shadow.c b/xen/arch/x86/shadow.c index 1db8ed71e9..4413d48da0 100644 --- a/xen/arch/x86/shadow.c +++ b/xen/arch/x86/shadow.c @@ -981,12 +981,12 @@ int __shadow_mode_enable(struct domain *d, unsigned int mode) return 0; nomem: - if ( (new_modes & SHM_enable) && (d->arch.shadow_ht != NULL) ) + if ( (new_modes & SHM_enable) ) { xfree(d->arch.shadow_ht); d->arch.shadow_ht = NULL; } - if ( (new_modes & SHM_log_dirty) && (d->arch.shadow_dirty_bitmap != NULL) ) + if ( (new_modes & SHM_log_dirty) ) { xfree(d->arch.shadow_dirty_bitmap); d->arch.shadow_dirty_bitmap = NULL; diff --git a/xen/common/dom0_ops.c b/xen/common/dom0_ops.c index da454a479a..dcab2dd0d3 100644 --- a/xen/common/dom0_ops.c +++ b/xen/common/dom0_ops.c @@ -349,8 +349,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op) if ( copy_to_user(op->u.getdomaininfo.ctxt, c, sizeof(*c)) ) ret = -EINVAL; - if ( c != NULL ) - xfree(c); + xfree(c); } if ( copy_to_user(u_dom0_op, op, sizeof(*op)) ) diff --git a/xen/common/domain.c b/xen/common/domain.c index 742ca462a5..1184dbaf67 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -257,8 +257,7 @@ int set_info_guest(struct domain *p, dom0_setdomaininfo_t *setdomaininfo) set_bit(DF_CONSTRUCTED, &p->d_flags); out: - if ( c != NULL ) - xfree(c); + xfree(c); return rc; } @@ -313,8 +312,7 @@ long do_boot_vcpu(unsigned long vcpu, full_execution_context_t *ctxt) return 0; out: - if ( c != NULL ) - xfree(c); + xfree(c); arch_free_exec_domain_struct(d->exec_domain[vcpu]); d->exec_domain[vcpu] = NULL; return rc; diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index ca7ee36495..7fdc92c9b9 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -1122,8 +1122,7 @@ grant_table_create( no_mem: if ( t != NULL ) { - if ( t->active != NULL ) - xfree(t->active); + xfree(t->active); if ( t->maptrack != NULL ) free_xenheap_page((unsigned long)t->maptrack); xfree(t); diff --git a/xen/common/physdev.c b/xen/common/physdev.c index de3bd331a1..d1eee0a307 100644 --- a/xen/common/physdev.c +++ b/xen/common/physdev.c @@ -146,11 +146,8 @@ void physdev_destroy_state(struct domain *d) { struct list_head *ent; - if ( d->arch.iobmp_mask != NULL ) - { - xfree(d->arch.iobmp_mask); - d->arch.iobmp_mask = NULL; - } + xfree(d->arch.iobmp_mask); + d->arch.iobmp_mask = NULL; while ( (ent = d->pcidev_list.next) != &d->pcidev_list ) { -- 2.30.2